<mk-box [isRemovable]="false">
  <mk-box-header></mk-box-header>
  <mk-box-content>
    <div class="col-lg-12">
      <div class="form-inline">
        <div class="form-group pull-right">
          <input type="text" class="form-control" placeholder="设备ID" [(ngModel)]="filterDeviceId">
          <select class="form-control" [(ngModel)]="filterLevel">
            <option value="-1">无</option>
            <option value="0">警告</option>
            <option value="1">严重</option>
          </select>
          <input class="form-control" type="button" value="筛选" (click)="refresh()">
        </div>
      </div>
    </div>
    <div class="col-lg-12" style="margin-top: 20px;">
      <div class="table-responsive">
        <table class="table table-bordered">
          <thead>
          <tr>
            <th><input type="checkbox"></th>
            <th>设备ID</th>
            <th>等级</th>
            <th>本次数据</th>
            <th>产生时间</th>
            <th>状态</th>
            <th>操作</th>
          </tr>
          </thead>
          <tbody>
          <tr *ngFor="let log of logs">
            <td><input type="checkbox"></td>
            <td>{{log.deviceId}}</td>
            <td>{{log['levelStr']}}</td>
            <td>{{log.data}}</td>
            <td>{{log.createTime}}</td>
            <td>{{(log.handle==null || log.handle=="" || log.handle==undefined)?"未处理":"已处理"}}</td>
            <td>
              <div class="btn-toolbar" style="display: flex;">
                <button class="btn btn-primary btn-xs" (click)="showDetail(log)">查看详情</button>
                <button class="btn btn-danger btn-xs" (click)="deleteLog(log)" *ngIf="user.me.level<2">删除</button>
              </div>
            </td>
          </tr>
          </tbody>
        </table>
      </div>
    </div>
    <div class="col-lg-12">
      <div class="form-inline">
        <div class="form-group pull-right">
          <input class="form-control" type="button" value="上一页" [disabled]="page==1" (click)="goto(page-1)">
          <input class="form-control" style="width: 40px" type="text" [value]="page" #gotoPage>
          <span>{{' /'+maxPage+' '}}</span>
          <input class="form-control" type="button" value="前往" (click)="goto(gotoPage.value)">
          <input class="form-control" type="button" value="下一页" (click)="goto(page+1)">
        </div>
      </div>
    </div>
  </mk-box-content>
</mk-box>

